package org.adoxx.adows.client.main; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import javax.xml.rpc.ServiceException; import org.adoxx.adows.client.ADOxxWebService; import com.boc_eu.adoweb.adows.adoscript.GetModelDocuXML; /** * @author wutz * * Sample implementation to retreive the an XML representation of a * model. The XSD of the return is documented here: * http://www.adoxx.org/ * AdoScriptDoc/files/Message_Ports/Component_APIs/Documentation * /XML_MODEL_DOCU-js.html#XML_MODEL_DOCU * * FIXME: the return XML is currently available as a XML in String * format, in case further steps are needed, parsing of the return needs * to be implemented. * * FIXME: the modelid is hard-coded and needs to be dynamically * retrieved from TOC interaction * */ public class RunADOxxServiceInteractionModelDocuXML { public static void main(String[] args) throws ServiceException, IOException { // load property for endpoint reference Properties prop = new Properties(); InputStream inputStream = RunADOxxServiceInteractionModelDocuXML.class.getClassLoader().getResourceAsStream("config.properties"); prop.load(inputStream); // Construct the ADOxx service as a singleton in the application. ADOxxWebService service = ADOxxWebService.getInstance(prop.getProperty("endpoint")); // Create the interaction object, using the service, the modelid and a // boolean if record rows should be included as an input, // implictly triggers the service interaction, the returned XML is in // accordance with the schema available here // http://www.adoxx.org/AdoScriptDoc/files/Message_Ports/Component_APIs/Documentation/XML_MODEL_DOCU-js.html#XML_MODEL_DOCU GetModelDocuXML modelXML = new GetModelDocuXML(service, 11201, true); // Handle the results System.out.println(modelXML.getResult()); } }